[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Pred                     Returns the Predecessor of Any Ordinal

 Pred(OVal : <ordtype>) : <ordtype>;

    Returns the preceding value of OVal. The result is not defined if OVal
    is the first possible value of <ordtype>. If OVal is an Integer,
    Pred(OVal) = OVal - 1.

            OVal    An ordinal value (constant, variable, function call,
                    or expression).

       <ordtype>    Any ordinal type: Integer, Char, Boolean, or
                    enumerated data type.

         Limits:    if range checking is enabled {$R+} and OVal is the
                    first value in <ordtype>, runtime error 145 ($91)
                    occurs. If {$R-}, Pred(OVal) returns a value based on
                    the size and range of <ordtype>; if <ordtype> is one
                    byte in size and Ord(Oval) = 0, Ord(Pred(Oval)) = 255.

  -------------------------------- Example ---------------------------------

           Ch := Pred('B');         { Ch = 'A' }
           I  := Pred(21);          { I  = 20  }

See Also: Succ Ord Retype Chr
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson